package com.avengers.common.bean;

import com.avengers.common.wx.BinaryUtil;

import java.util.List;

/**
 * @author zhangnan
 * @since 2021/8/4 5:44 下午
 **/
public class AccountNotifySet {
    private String userId;
    private String email;
    private String dns;
    private String phone;
    private boolean emailNotify = false;
    private boolean smsNotify = false;
    private boolean wxNotify = false;
    private Integer notifyWay;
    private String userName;

    public AccountNotifySet(int way) {
        List<Integer> ways = BinaryUtil.toList(way);
        this.emailNotify = ways.contains(1);
        this.smsNotify = ways.contains(2);
        this.wxNotify = ways.contains(4);
        this.notifyWay = way;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getDns() {
        return dns;
    }

    public void setDns(String dns) {
        this.dns = dns;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public boolean isEmailNotify() {
        return emailNotify;
    }

    public void setEmailNotify(boolean emailNotify) {
        this.emailNotify = emailNotify;
    }

    public boolean isSmsNotify() {
        return smsNotify;
    }

    public void setSmsNotify(boolean smsNotify) {
        this.smsNotify = smsNotify;
    }

    public boolean isWxNotify() {
        return wxNotify;
    }

    public void setWxNotify(boolean wxNotify) {
        this.wxNotify = wxNotify;
    }

    public Integer getNotifyWay() {
        return notifyWay;
    }

    public void setNotifyWay(Integer notifyWay) {
        this.notifyWay = notifyWay;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
}